package globalinfo.core.model;

import java.util.Set;

/**
 * @author odupouy
 *
 * @param <T>
 */
public interface Namer<T> {
	
	/**
	 * @return
	 */
	String getNamerID();
	
	/**
	 * @return a copy of provided objects.
	 */
	Set<T> getObjects();
	
	/**
	 * @param objectID
	 * @return
	 */
	T getObjectByID(String objectID);
	
	/**
	 * @param object
	 * @return
	 */
	String getObjectID(T object);
	
	/**
	 * @param object
	 * @return this for convenience.
	 */
	Namer<T> addObject(T object);
	
	/**
	 * @param object
	 * @return this for convenience.
	 */
	Namer<T> removeObject(T object);
	
	/**
	 * @param oldObj
	 * @param newObj
	 * @return this for convenience.
	 */
	Namer<T> replaceObject(T oldObj, T newObj);
	
	/**
	 * @param l
	 */
	void addObjectListener(ObjectListener<? super T> l);
	
	/**
	 * @param l
	 */
	void removeObjectListener(ObjectListener<? super T> l);

}
